﻿Ext.define('app.prm.project_task.ChildTask',
{
    extend: 'Ext.window.Window',
    modal: true,
    width: 700,
    height: 500,
    layout: 'fit',
    title: '子任务',
    projectTaskId: 0,
    bodyStyle: 'padding:3px',
    initComponent: function () {
        var me = this;
        me.items = [me.getGrid()];
        me.callParent();
    },
    getGrid: function () {
        var me = this;
        if (!this.taskGrid) {
            this.taskGrid = new Ext.grid.Panel({
                border: false,
                viewConfig: {
                    enableTextSelection: true //可以复制单元格文字
                },
                store: Ext.create("app.ux.PrmStore", { url: '/api/services/app/projectTask/GetSubTasks?taskId=' + me.projectTaskId }),
                forceFit: true,
                columns: [
                    { header: '内容', dataIndex: 'subTitle' },
                    { xtype: 'checkcolumn', header: '是否完成', maxWidth: 100, dataIndex: 'completed' }
                ]
            });
        }
        return this.taskGrid;
    }
});